package com.study8.jetcache.service.impl;

import com.alicp.jetcache.anno.Cached;
import com.study8.jetcache.model.CarrierCode;
import com.study8.jetcache.service.CarrierCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


/**
 * @author xuly
 * @title: CarrierCodeServiceImpl
 * @projectName spring-boot
 * @description: TODO
 * @date 2019-07-2411:35
 **/
@Service("carrierCodeService")
@Slf4j
public class CarrierCodeServiceImpl implements CarrierCodeService {

    @Override
    @Cached(name="CarrierCodeServiceImpl", expire = 3600)
    public CarrierCode getById(Integer id) {
        log.info(">>>>>>>>>>>>>");
        CarrierCode carrierCode = new CarrierCode();
        carrierCode.setId(id);
        return carrierCode;
    }

    @Override
    public void deleteId(Integer id) {

    }

    @Override
    public CarrierCode update(Integer id) {
        CarrierCode carrierCode = new CarrierCode();
        carrierCode.setId(id);
        carrierCode.setCarrierCode("test");
        return carrierCode;
    }

}
